{% extends 'mutifuncbase.html' %}

{% block content %}
    <h1>请选择需要通过大模型进行代码生成的函数名称</h1>
    <input type="hidden" name="app_uuid" id="app_uuid" value="{{ app_uuid }}">
    <div class="button-container">
        {% for function in functions %}
            <button onclick="navigateToFunction('{{ function }}')">{{ function }}</button>
        {% endfor %}
    </div>
{% endblock %}

{% block scripts %}
    <script>
        function navigateToFunction(funcName) {
            const baseUrl = "http://182.92.70.30:779/llama3/generate";
            const uuid = document.getElementById("app_uuid").value;  // 从隐藏输入字段中获取UUID
            const url = `${baseUrl}?uuid=${uuid}&funcname=${encodeURIComponent(funcName)}`;
            window.location.href = url;
        }
    </script>
{% endblock %}
